<template>
  <div>
    <ul class="list-box">
      <li class="goods-box" v-for="item in List" :key="item.proid">
        <img class="img" :src="item.img1" />
        <p>{{ item.proname }}</p>
        <span>¥{{ item.originprice }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
import service from "../../utils/service";
export default {
  data() {
    return {
      List: [],
    };
  },
  mounted() {
    service({
      url: "/api/pro/recommendlist",
      method: "get",
      params: {
        count: this.count,
        limitNum: this.limitNum,
      },
    }).then((res) => {
      res.data.data.forEach((element) => {
        this.List.push(element);
      });
    });
  },
};
</script>

<style  scoped>
.list-box {
  width: 100%;
  height: auto;
  background: #efefef;
  box-sizing: border-box;
  padding: 10px 10px;
  column-count: 2;
  padding-bottom: 80px;
}

.goods-box {
  background: #ffffff;
  border-radius: 10px;
  margin-bottom: 10px;
  break-inside: avoid;
}

img {
  width: 100%;
  margin-bottom: 10px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

p {
  font-size: 14px;
  color: #000;
  margin: 10px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

span {
  color: #ff6666;
  font-size: 22px;
  margin: 10px;
}
</style>